package cdc.rxjava2.demo;

import io.reactivex.Flowable;
import io.reactivex.functions.Consumer;
public class Hello2 {
	/**
	 * create a flowable Publisher:出版者;
	 * 
	 * subscribe:订阅
	 * 
	 * 平常用得最多的Publisher是Flowable
	 * 
	 **/
	Flowable<String> flowable = Flowable.just("RxJava2 Hello2");
	/**
	 * consumer:消费者
	 **/
	private Consumer<String> consumer = new Consumer<String>() {
	    @Override
	    public void accept(String s) throws Exception {
	        System.out.println(s);
	    }
	};
	
	public Hello2() {
		flowable.subscribe(consumer);
	}

}
